import os 

GCC_PATH='E:/armgcc/bin/'
CC=GCC_PATH+'arm-none-eabi-gcc'

LINK=GCC_PATH+'arm-none-eabi-gcc'

TARGET="nano.elf"

SRC_C =Glob('src/*.c')
 
INC="src"

CFLAGS="\
-mcpu=cortex-m23 \
-mthumb \
-Wall \
-fdata-sections -ffunction-sections \
-g \
-gdwarf-2 \
-O0 \
-g3 \
"

LDFLAGS="\
-mcpu=cortex-m23 \
-Wl,--gc-sections \
-Tlink.ld \
"
 
env=Environment(CC = CC, CPPPATH = INC, CFLAGS = CFLAGS, LINKFLAGS = LDFLAGS, LINK = LINK )

# env=Environment(CC=CC,CPPPATH = INC )
# print ("CC is:", env['CC'])
# print ("CFLAGS is:", env['CFLAGS'])
# print ("LINKFLAGS is:", env['LINKFLAGS'])

# print ("env:", env.Dump())
# print(SRC_C)
env.Program(target =TARGET,source = SRC_C)



